package mapreduceFilterPath;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.PathFilter;

public class FilePathFilter extends Configured implements PathFilter {
	Configuration conf = new Configuration();
	@Override
	public Configuration getConf() {
		return conf;
	}

	@Override
	public boolean accept(Path path) {
		String regex=conf.get("org.test.filter.regex");
		if(regex==null){
			return true;
		}
		return path.toString().matches(regex);
	}

}
